<?php

namespace app\api\validate;

use think\Validate;

class Register extends Validate
{

    protected $rule = [
        'user_number' => 'require|unique:user',
        'password' => 'require',
        'confirm_password' => 'require',
        'department_id' => 'number',
        'major_id' => 'number',
        'class_id' => 'number'
    ];

    protected $message = [
        'user_number.require' => '学生编号不能为空',
        'user_number.unique' => '该学生已经注册了',
        'password.require' => '密码不能为空',
        'confirm_password.require' => '重复密码不能为空',
        'department_id.number' => '请选择学院',
        'major_id.number' => '请选择专业',
        'class_id.number' => '请选择班级'
    ];

}